Number.prototype.formatMoney = function(c, d, t){
var n = this, 
    c = isNaN(c = Math.abs(c)) ? 2 : c, 
    d = d == undefined ? "." : d, 
    t = t == undefined ? "," : t, 
    s = n < 0 ? "-" : "", 
    i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", 
    j = (j = i.length) > 3 ? j % 3 : 0;
   return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
 };

function CurrencyFormatted(amount) {
                                    if(!amount) return 0;
                                    amount = Number((amount + '').replace(/[^\d]/g, ''));
                                    if(isNaN(amount)) return 0;
                                    amount = (amount + '').split('').reverse().join('').replace(/(\d{3})/g, '$1.').split('').reverse().join('');;
                                    if(amount[0] == '.')
                                     amount = amount.substr(1);
                                    return amount;
                                   }
function formatAmount(amount)
{
	return amount.formatMoney(2,',','.');
}

 function get_img(){
        var st= location.protocol + "//" + location.hostname + location.pathname+'img/shop.gif';
        return st;
 }

function formatDate(timestamp)
{
	var dt = new Date(timestamp);

	var date = dt.getDate();
	var month = dt.getMonth() + 1;
	var year = dt.getFullYear();
    var hours = dt.getHours();
    var minutes = dt.getMinutes();
    var seconds = dt.getSeconds();

    // the above dt.get...() functions return a single digit
    // so I prepend the zero here when needed
    if (date < 10)
     date = '0' + date;
     
    if (month < 10)
     month = '0' + month; 	
    
    if (hours < 10) 
     hours = '0' + hours;

    if (minutes < 10) 
     minutes = '0' + minutes;

    if (seconds < 10) 
     seconds = '0' + seconds;

    return date + "/" + month + "/" + year + " " + hours + ":" + minutes + ":" + seconds;
}
